﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ISS.IR.RRNMS.Library.DataAccess;

namespace ISS.IR.RRNMS.Library.BusinessLogic
{
    public static class Slots
    {
        public static List<Item> SelectListOfAllSlots()
        {
            try
            {
                List<Slot> slots = Main.SelectListOfAllSlots();
                List<Item> item = new List<Item>();
                for (int i = 0; i < slots.Count; i++)
                {
                    //slots.Add(new Library.Slot());
                    Item temp = new Item();
                    temp.GUID = Guid.Parse(Convert.ToString(slots[i].SlotId));
                    temp.Value = slots[i].ToString();
                    item.Add(temp);
                }

                return item;
            }
            catch (Exception e)
            { return null; }


        }

        public static void SaveSlot(Slot s)
        {
            Main.SaveSlot(s);
        }

        public static void DeleteSlot(Guid SlotId)
        {
            Main.DeleteSlot(SlotId);
        }

        public static Slot SelectSlot(Guid SlotId)
        {
            return Main.SelectOneSlot(SlotId);
        }
    }
}
